<div class="hts-doc-text">

 <img src="docresources/configdvrtab1.png">
 <br>
 <img src="docresources/configdvrtab2.png">
 <br>
 <img src="docresources/configdvrtab3.png">

 <p>
 This tab is used to configure operation of the Digital Video Recorder.
 It is not used for scheduling or administration of individual recordings.

 <p>
 Configuration options:
 
 <dl>
  
  <br><br>
  <hr>
  <b>DVR Behaviour</b>
  <hr>
  
  <dt>Media container
  <dd>Select the container format used to store recordings.

  <dt>Cache scheme
  <dd>Select the cache scheme used to store recordings. Leave as "system" unless you have a special case for one of the others.
  <br><br>  
  <dd>Whenever you read or write data to the filesystems, the information is kept (cached) in memory for a while. This means that regularly-access files are available quickly without going back to the disc; it also means that there's a disconnect when writing between the write request (from the application) and the actual write itself (to the disc/storage) as changes are buffered to be written in one go.</dd>

    <dl>

      <dt>Unknown</dt>
      <dd>A placeholder status, meaning that the configuration isn't properly set.</dd>

      <dt>System</dt>
      <dd>Change nothing and rely on standard (default) system caching to behave as it normally would.</dd>

      <dt>Do not keep</dt>
      <dd>Tell the system that you're not expecting to re-use the data soon, so don't keep it in cache. The data will still be buffered for writing. <i>Useful e.g. in a RAM-limited system like a Pi (given that you're unlikely to be watching while recording, so data can be discarded now and read back from disc later).</i></dd>

      <dt>Sync</dt>
      <dd>Tell the system to write the data immediately. This doesn't affect whether or not it's cached. <i>Useful e.g. if you've a particular problem with data loss due to delayed write (such as if you get frequent transient power problems).</i></dd>

      <dt>Sync + Do not keep</dt>
      <dd>A combination of last two variants above - data is written immediately and then discarded from cache.</dd>

    </dl>
    
  <dt>DVR Log retention time (days)
  <dd>Time that Tvheadend will keep information about the recording in its internal database. Notice that the actual recorded file will not be deleted when the log entry is deleted.

  <dt>Extra time before recordings (minutes)
  <dd>Specify the number of minutes to record before the events scheduled start time. Used to cope with small scheduling errors.

  <dt>Extra time after recordings (minutes)
  <dd>Specify the number of minutes to record after the events scheduled stop time. Used to cope with small scheduling errors.

  <dt>Episode duplicate detection
  <dd>If checked, broadcasts with matching title and matching non-zero episode number 
      are considered duplicates.

  <dt>EPG update window
  <dd>Maximum difference between event start times when the EPG event is changed.
      TVHeadend uses a fuzzy match logic (using title, start times,
      duration, episode) to check when the event was changed.

  <dt>Post-processor command
  <dd>Command to run after finishing a recording. The command will be run in background and is executed even if a recording is aborted or an error occurred. Use the %e error formatting string to check for errors, the error string is "OK" if recording finished successfully.
      <br><br>
      Support format strings:<br>
      <table class="hts-doc-text" border="0">
        <tr><th>Format</th><th>Description</th><th>Example value</th></tr>
        <tr><td>%f</td><td>Full path to recording</td><td>/home/user/Videos/News.mkv</td></tr>
        <tr><td>%b</td><td>Basename of recording</td><td>News.mkv</td></tr>
        <tr><td>%c</td><td>Channel name</td><td>BBC world</td></tr>
        <tr><td>%O</td><td>Owner of this recording</td><td>user</td></tr>
        <tr><td>%C</td><td>Who created this recording</td><td>user</td></tr>
        <tr><td>%t</td><td>Program title</td><td>News</td></tr>
        <tr><td>%s</td><td>Program subtitle</td><td>Afternoon</td></tr>
        <tr><td>%p</td><td>Program episode</td><td>S02.E07</td></tr>
        <tr><td>%d</td><td>Program description</td><td>News and stories...</td></tr>
        <tr><td>%e</td><td>Error message</td><td>Aborted by user</td></tr>
        <tr><td>%S</td><td>Start time stamp of recording, UNIX epoch</td><td>1224421200</td></tr>
        <tr><td>%E</td><td>Stop time stamp of recording, UNIX epoch</td><td>1224426600</td></tr>
      </table>
      <br>
      Example usage: /path/to/ffmpeg -i "%f" -vcodec libx264 -acodec copy "/path/with white space/%b"<br>
      You need to use quotes or escape white spaces if you want white spaces in an argument.
 
  <br><br>
  <hr>
  <b>Recording File Options</b>
  <hr>
       
  <dt>Recording system path
  <dd>Path to where Tvheadend will write recorded events. If components of the path does not exist, Tvheadend will try to create them.
 
  <dt>File permissions
  <dd>The permissions to be set on the resultant recording files. This is useful if you need to manipulate the files after recording under a different user ID, e.g. to chop out commercials.
      
      <table class="hts-doc-text" border="0">
      <tr><td>Common examples:</td></tr> 
      <br>
      <tr><td>0644 == rw-r--r--</td></tr>
      <tr><td>0664 == rw-rw-r-- (default)</td></tr>
	  <tr><td>0666 == rw-rw-rw-</td></tr>
	  </table>
	  
	  Note that the applicable umask applies, so 0666 with umask 0022 will produce 0644 (rw-r--r--).
	  
	  See also <i>Directory permissions</i> in <i>Subdirectory Options</i>. 
	  
  <dt>Filename charset
  <dd>Character set for the created filename. Tvheadend will try to approximate characters to similarly looking ones.

  <dt>Tag files with metadata
  <dd>If checked, media containers that support metadata will be tagged with the metadata associated with the event being recorded.

  <dt>Skip commercials
  <dd>If checked, commercials will be dropped from the recordings. At the moment, commercial detection only works for the swedish channel TV4.

  <br><br>
  <hr>
  <b>Full Pathname Specification</b>
  <hr>

  <dt>Format String
  <dd>The string allow to manually specify the full path generation using
  the predefined modifiers for strftime (see '<i>man strftime</i>', except
  <i>%n</i> and <i>%t</i>) and Tvheadend specific. Note that you may modify some of
  this format string setting using the GUI fields bellow.

      <table class="hts-doc-text" border="0">
      <tr><th>Format</th><th>Description</th><th>Example</th></tr>
      <br>
      <tr><td>$t$n.$x</td><td>Default format (title, unique number, extension)</td><td>Tenis - Wimbledon-1.mkv</td></tr>
      <br>
      <tr><td>$t</td><td>Event title name</td><td>Tenis - Wimbledon</td></tr>
      <tr><td>$s</td><td>Event subtitle name</td><td>Sport</td></tr>
      <tr><td>$e</td><td>Event episode name</td><td>S02-E06</td></tr>
      <tr><td>$c</td><td>Channel name</td><td>SkySport</td></tr>
      <tr><td>$n</td><td>Unique number added when the file already exists&nbsp;&nbsp;&nbsp;&nbsp;</td><td>-1</td></tr>
      <tr><td>$x</td><td>Filename extension (from the active stream muxer</td><td>mkv</td></tr>
      <br>
      <tr><td>%F</td><td>ISO 8601 date format</td><td>2011-03-19</td></tr>
      <tr><td>%R</td><td>The time in 24-hour notation</td><td>14:12</td></tr>
      </table>

  The format strings <i>$t,$s,%e,$c</i> have also delimiter variants like
  <i>$ t</i> (space after the dolar character), <i>$-t</i>, <i>$_t</i>,
  <i>$.t</i>, <i>$,t</i>, <i>$;t</i>, . In this case, the delimiter is applied
  only when the substituted string is not empty.

  <br><br>
  <hr>
  <b>Subdirectory Options</b>
  <hr>
   
  <dt>Directory permissions
  <dd>The permissions to be set on any sub-directories created for recordings. This is useful if you need to manipulate the files after recording under a different user ID, e.g. to chop out commercials.
      
      <table class="hts-doc-text" border="0">
      <tr><td>Common examples:</td></tr> 
      <br>
      <tr><td>0755 == rwxr-xr-x</td></tr>
      <tr><td>0775 == rwxrwxr-x (default)</td></tr>
      <tr><td>0777 == rwxrwxrwx</td></tr>
      </table>
	  
      Note that the applicable umask applies, so 0777 with umask 0022 will produce 0755 (rwxr-xr-x).
	  
      See also <i>File permissions</i> in <i>Recording File Options</i>.
	  
  <dt>Make sub-directories per day
  <dd>If checked, create a new directory per day in the recording system path. Only days when anything is recorded will be created. The format of the directory will be 'YYYY-MM-DD' (ISO standard)

  <dt>Make sub-directories per channel
  <dd>If checked, create a directory per channel when storing events. If both this and the 'directory per day' checkbox is enabled, the date-directory will be parent to the per-channel directory.

  <dt>Make sub-directories per title
  <dd>If checked, create a directory per title when storing events. If the day/channel directory checkboxes are also enabled, those directories will be parents of this directory.

  <br><br>
  <hr>
  <b>Filename Options</b>
  <hr>
  
  <dt>Include channel name in title
  <dd>If checked, include the name of the channel in the event title. This applies to both the titled stored in the file and to the file name itself.

  <dt>Include date in title
  <dd>If checked, include the date for the recording in the event title. This applies to both the titled stored in the file and to the file name itself.

  <dt>Include time in title
  <dd>If checked, include the time for the recording in the event title. This applies to both the titled stored in the file and to the file name itself.

  <dt>Include episode in title
  <dd>If checked, include the season and episode in the title (if such info is available).

  <dt>Include subtitle in title
  <dd>If checked, include the episode subtitle in the title (if such info is available).

  <dt>Put episode in filename before date and time
  <dd>If checked, insert the episode number before the data and time rather than after (assumes <i>Include date</i>, <i>Include time</i> and <i>Include episode</i> options are set).
	  
  <dt>Remove all unsafe characters from filename
  <dd>If checked, all characters that could possibly cause problems for filenaming will be replaced with '_'.<br>
  	  Applies to characters:<br>
      * not supported by Windows characters: <i>/ : \ < > | * ? "</i><br>
      * control characters (ASCII code below 32)<br>
      * control and national characters (ASCII code above 122)<br> 
  
  <dt>Replace whitespace in title with '-'
  <dd>If checked, whitespace characters (spaces and tabs) will be replaced with '-'.
  
  <dt>Use Windows-compatible filenames
  <dd>If checked:<br>
      * special characters not supported by Windows like: <i>/ : \ < > | * ? "</i> will be replaced with '_'<br>
      * trailing spaces ' ' and dots '.' will be removed
  
 </dl>
 Changes to any of these settings must be confirmed by pressing the 'Save configuration' button before taking effect.
</div>
